function Block (position, color) {
  this.position = position
  this.color = color
}

Block.prototype = {
  rotate (dimension, step) {
    let i = 0
    switch (dimension) {
      case Dimension.x:
        for (i = 0; i < step; i++) {
          this.position.rotateX()
          this.color.rotateX()
        }
        break
      case Dimension.y:
        for (i = 0; i < step; i++) {
          this.position.rotateY()
          this.color.rotateY()
        }
        break
      case Dimension.z:
        for (i = 0; i < step; i++) {
          this.position.rotateZ()
          this.color.rotateZ()
        }
        break
    }
  }
}